<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册框</title>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style>
        .user{
            display: block;
            height: 50px;
            width: 100%;
            border-radius: 5px;
            padding-left: 50px;
            background-color: white !important;
            border: none;
        }
        input{
            margin: 20px;

        }
        .check{
            width: 100px;
            height: 40px;
            border-radius: 5px;
            display: block;
            margin: 0 auto;
            background: white;

        }
        #big{
            background: url("images/bg.jpg");
        }
    </style>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-8 col-sm-8"id="big" style="margin: 50px;padding: 20px" >
        <form action="" style="width: 50%">
            <p>已有账户？<a href="分销登录.html">立即登录</a></p>
            <input type="text" id="user" class="user" placeholder="请输入用户名"style="background: url('images/tb.png') -30px -5px no-repeat">
            <input type="password" id="password" class="user"placeholder="请输入密码"style="background: url('images/tb.png') -30px -56px no-repeat">
            <input type="text"class="user" id="phone" placeholder="请输入手机号"style="background: url('images/tb.png') -30px -113px no-repeat">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for=""><input type="checkbox"><a href="协议内容.html">我同意该协议</a></label>
            <br>
            <input type="button"class="check" value="立即注册">
        </form>
        </div>
    </div>
    </div>
</div>
<script>
window.onload=function (ev) {
    var user=document.getElementById('user');
    var phone=document.getElementById('phone');
    phone.onkeydown=function (ev) {
        var oEvent=ev||event;
        if(((oEvent.keyCode >=48)&&(oEvent.keyCode <=57))||((oEvent.keyCode >=96)&&(oEvent.keyCode <=105))){
           return true;
        }else if(oEvent.keyCode ==8){
            phone.value=""
        }
        else {
            alert("请输入正确的电话格式")
            return false;
        }

    }
}
</script>
</body>
</html>